feat: Cloudflare Pages 部署支持 + 扫码登录兼容修复#164
Open
vmxmy wants to merge 1 commit into
Open
Conversation
- 添加 wrangler.toml,绑定 KV namespace(id: 22d46ff673c946f1a5f3b790818b5618) - nuxt.config.ts 加入 preset/binding 配置,确保 cloudflare_pages 预设和 KV 正确注入 - package.json 补充 deploy/preview 脚本(输出目录从 .output 修正为 dist) - 抽取 server/utils/set-cookie.ts:extractSetCookieValues 在 CF Workers 运行时兼容 getSetCookie() 不可靠的问题,加入正则回退路径 - server/services/api/mp-gateway.ts 统一使用 extractSetCookieValues,加入 [login] 诊断日志(native/extracted 计数) - server/services/api/auth-session.ts getCookieValueFromResponse 改用 extractSetCookieValues,消除另一处裸 getSetCookie() 调用 - bizlogin.post.ts 错误透传:不再吞掉上游 base_resp.err_msg,方便定位 KV 写入失败等具体原因 - 重构 server/services/ 目录(auth-session, mp-gateway, mp-service, session-core, mp-core) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wrangler.toml,绑定 KV namespace 用于会话存储nuxt.config.ts加入preset: process.env.NITRO_PRESET和binding: 'KV',确保cloudflare_pages预设和 KV 正确注入package.json补充deploy/preview脚本(输出目录修正为dist)server/utils/set-cookie.ts:extractSetCookieValues兼容 CF Workers 运行时getSetCookie()不可靠问题,提供正则回退路径mp-gateway.ts统一使用extractSetCookieValues,加入[login]诊断日志(native/extracted 计数)auth-session.tsgetCookieValueFromResponse改用extractSetCookieValues,消除裸getSetCookie()调用bizlogin.post.ts错误透传:不再吞掉上游base_resp.err_msg,方便定位 KV 写入失败等具体原因server/services/目录(auth-session, mp-gateway, mp-service, session-core, mp-core)Test plan
yarn deploy)/api/public/v1/download接口可正常获取文章内容(text / json 格式验证通过)🤖 Generated with Claude Code